<?

class countries {


// FUNCTION // get a single country
function get_country($params){

	// use safe function
	$params = in($params);

	if($params['iso2']) $sql_where .= " AND iso2 = '".$params['iso2']."' ";

	
	$sql = "SELECT *
	FROM countries
	WHERE 1 = 1
	".$sql_where."
	LIMIT 1";

	
	$result = mysql_query($sql) or die (mysql_error());
	$num_rows = mysql_num_rows($result);

	if($num_rows){
		$row = mysql_fetch_array($result, MYSQL_BOTH);
		$row = array_map('array_stripslashes', $row);
		return $row;
	}else{
		return false;
	}
	

}





}
